package com.sdyeda.dtu;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.sdyeda.dtu.fx.MainWindow;
import com.sdyeda.dtu.fx.Tray;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;

@SpringBootApplication
public class DtuServerApplication extends Application {
	
	public static Stage primarystage;

	public static void main(String[] args) {
		try {
			new Tray();
		}
		catch(Exception e){
		}
		SpringApplication.run(DtuServerApplication.class, args);
		try {	//针对无界面
			launch(args);
		}
		catch(Exception e) {
			//System.out.println(e);
		}
	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		Platform.setImplicitExit(false);
		DtuServerApplication.primarystage = primaryStage;
		new MainWindow();
	}

}
